<!--# layout("/common/layout.html",{"jsBase":"/js/base/baseUniv/"}){ -->
<style>
    .layui-icon-edit:before {
        font-size: 17px !important;
    }
    .layui-icon-ok:before{
        font-size: 17px !important;
    }
    .layui-icon-close-fill:before{
        font-size: 17px !important;
    }
    .layui-input-inline{
        display: flex;
        align-items: center;
        margin-right: 10px;
    }
</style>
<form class="layui-form layui-form-pane" id="addForm" enctype="multipart/form-data"  lay-filter="editform">
    <input type="hidden" name="univId" id="univId">

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width:120px;">大学名称</label>
                <div class="layui-input-inline">
                    <span style="line-height:38px;margin-left:8px;" id="univNameSpan">
                       ${baseUniv.univName}
                    </span>
                    <input type="text" name="univName" id="univName" autocomplete="off" maxlength="50" class="layui-input" />

                    <i class="layui-icon layui-icon-edit" id="univNameEdit" fieldName="univName" style="font-size: 12px; color: #00CD66;"></i>
                    <i class="layui-icon layui-icon-ok layui-hide" id="univNameOk"  fieldName="univName" style="font-size: 12px; color: #00EE76;"></i>
                    <i class="layui-icon layui-icon-close-fill layui-hide" id="univNameClose" fieldName="univName" style="font-size: 12px; color: #FF3030;"></i>

                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">主管部门</label>
                <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="competentDepartSpan">
                               ${baseUniv.competentDepart}
                        </span>
                    <input type="text" name="competentDepart" id="competentDepart" autocomplete="off" maxlength="50" class="layui-input" />
                    <i class="layui-icon layui-icon-edit" id="competentDepartEdit" fieldName="competentDepart" style="font-size: 12px; color: #00CD66;"></i>
                    <i class="layui-icon layui-icon-ok layui-hide" id="competentDepartOk"  fieldName="competentDepart" style="font-size: 12px; color: #00EE76;"></i>
                    <i class="layui-icon layui-icon-close-fill layui-hide" id="competentDepartClose" fieldName="competentDepart" style="font-size: 12px; color: #FF3030;"></i>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:120px;">学校官网地址</label>
                <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="urlSpan">
                               ${baseUniv.url}
                        </span>
                    <input type="text" name="url" id="url" autocomplete="off" maxlength="50" class="layui-input" />
                    <i class="layui-icon layui-icon-edit" id="urlEdit" fieldName="url" style="font-size: 12px; color: #00CD66;"></i>
                    <i class="layui-icon layui-icon-ok layui-hide" id="urlOk"  fieldName="url" style="font-size: 12px; color: #00EE76;"></i>
                    <i class="layui-icon layui-icon-close-fill layui-hide" id="urlClose" fieldName="url" style="font-size: 12px; color: #FF3030;"></i>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width:120px;">学校联系方式</label>
                <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="contactSpan">
                               ${baseUniv.contact}
                        </span>
                    <input type="text" name="contact" id="contact" autocomplete="off" maxlength="50" class="layui-input" >
                    <i class="layui-icon layui-icon-edit" id="contactEdit" fieldName="contact" style="font-size: 12px; color: #00CD66;"></i>
                    <i class="layui-icon layui-icon-ok layui-hide" id="contactOk"  fieldName="contact" style="font-size: 12px; color: #00EE76;"></i>
                    <i class="layui-icon layui-icon-close-fill layui-hide" id="contactClose" fieldName="contact" style="font-size: 12px; color: #FF3030;"></i>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label text-r">行政区域：</label>

                <div style="display:inline">
                 <span style="line-height:38px;margin-left:8px" id="provIdSpan">
                        ${baseUniv.provName}
                 </span>
                    <span style="line-height:38px;margin-left:8px" id="citySpan">
                        ${baseUniv.cityName}
                 </span>
                </div>
                <div class="layui-inline"  id="provIdDiv" style="display:none">
                    <select  class="select" name="ProvinceId" id="provId" url="${ctxPath}/base/baseUniv/getProvinceList.json" child="CityId" childDataPath="${ctxPath}/base/baseUniv/getCityByProvId.json" selectValue="${baseUniv.provId}" promtion="请选择省" lay-search>
                        <option value="">请选择省</option>
                    </select>
                </div>
                <div class="layui-inline" id="cityDiv" style="display:none">
                    <select style="width:40%" class="select" name="CityId" id="city" selectValue="${baseUniv.city}" promtion="请选择市" lay-search>
                        <option value="">请选择市</option>
                    </select>
                </div>

                <i class="layui-icon layui-icon-edit" id="provIdEdit" fieldName="provId" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="provIdOk"  fieldName="provId" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="provIdClose" fieldName="provId" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div><!--form item-->
    </div><!--row-->


    <div class="layui-form-item">
        <div class="layui-inline">
            <!--  <layui:image id="logo" tagName="学校logo" tips="图片说明"/>-->
            <label class="layui-form-label text-r">学校logo：</label>
            <div class="layui-upload" style="display: inline;">
                <input type="hidden" name="logo" id="logo">
                <button type="button" class="layui-btn layui-hide" id="logoBtn" >选择图片</button>
                <div class="layui-upload-list">
                    <img class="layui-upload-img" id="logoImg" src="${baseUniv.logoView}">
                </div>
            </div>
            <i class="layui-icon layui-icon-edit" id="logoEdit" fieldName="logo" style="font-size: 12px; color: #00CD66;float: left;"></i>
            <i class="layui-icon layui-icon-ok layui-hide" id="logoOk"  fieldName="logo" style="font-size: 12px; color: #00EE76;"></i>
            <i class="layui-icon layui-icon-close-fill layui-hide" id="logoClose" fieldName="logo" style="font-size: 12px; color: #FF3030;"></i>

        </div>
    </div>


    <!--<div class="layui-row">-->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label text-r">大学背景图：</label>
            <div class="layui-upload" style="display: inline;">
                <input type="hidden" name="backGround" id="backGround">
                <button type="button" class="layui-btn layui-hide" id="backGroundBtn" >选择图片</button>
                <div class="layui-upload-list">
                    <img class="layui-upload-img" id="backGroundImg" src="${baseUniv.backGroundView}">
                </div>
            </div>
            <!--  <layui:image id="backGround" tagName="大学背景图" tips="图片说明"/>-->
            <i class="layui-icon layui-icon-edit" id="backGroundEdit" fieldName="backGround" style="font-size: 12px; color: #00CD66;"></i>
            <i class="layui-icon layui-icon-ok layui-hide" id="backGroundOk"  fieldName="backGround" style="font-size: 12px; color: #00EE76;"></i>
            <i class="layui-icon layui-icon-close-fill layui-hide" id="backGroundClose" fieldName="backGround" style="font-size: 12px; color: #FF3030;"></i>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">是否985</label>
            <div class="layui-input-inline">
            <span style="line-height:38px;margin-left:8px" id="is985Span">
                   ${baseUniv.is985==0?'否':'是'}
            </span>
                <div id="is985"  style="display: none">
                    <input type="radio" name="is985" value="1" ${baseUniv.is985==1?'checked':''} title="是">
                    <input type="radio" name="is985" value="0" ${baseUniv.is985==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="is985Edit" fieldName="is985" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="is985Ok"  fieldName="is985" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="is985Close" fieldName="is985" style="font-size: 12px; color: #FF3030;"></i>
            </div>

        </div>


        <div class="layui-inline">
            <label class="layui-form-label">是否211</label>
            <div class="layui-input-inline">
                <span style="line-height:38px;margin-left:8px" id="is211Span">
                       ${baseUniv.is211==0?'否':'是'}
                </span>

                <div id="is211" style="display: none">
                    <input type="radio" name="is211" value="1" ${baseUniv.is211==1?'checked':''} title="是">
                    <input type="radio" name="is211" value="0" ${baseUniv.is211==0?'checked':''} title="否">
                </div>
                <i class="layui-icon layui-icon-edit" id="is211Edit" fieldName="is211" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="is211Ok"  fieldName="is211" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="is211Close" fieldName="is211" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">是否双一流</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="isDoubleSpan">
                               ${baseUniv.isDouble==0?'否':'是'}
                        </span>
                <div id="isDouble" style="display: none">
                    <input type="radio" name="isDouble" value="1" ${baseUniv.isDouble==1?'checked':''} title="是">
                    <input type="radio" name="isDouble" value="0" ${baseUniv.isDouble==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="isDoubleEdit" fieldName="isDouble" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="isDoubleOk"  fieldName="isDouble" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="isDoubleClose" fieldName="isDouble" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>
    </div>

    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">是否公办</label>
            <div class="layui-input-inline">
                    <span style="line-height:38px;margin-left:8px" id="isPublicSpan">
                           ${baseUniv.isPublic==1?'是':'否'}
                    </span>
                <div id="isPublic" style="display: none">
                    <input type="radio" name="isPublic" value="1" ${baseUniv.isPublic==1?'checked':''} title="是">
                    <input type="radio" name="isPublic" value="0" ${baseUniv.isPublic==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="isPublicEdit" fieldName="isPublic" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="isPublicOk"  fieldName="isPublic" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="isPublicClose" fieldName="isPublic" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label" >院校类型</label>
            <div class="layui-input-inline">
                    <span style="line-height:38px;margin-left:8px" id="univTypeSpan">
                           ${baseUniv.dictValue}
                    </span>
                <div style="display: none;float: left" id="univTypeDiv">
                    <layui:simpleDataSelect name="univType" id="univType" value="${has(baseUniv)?baseUniv.univType:''}" style="width:100px" data="${univTypeList}" attrId="dictId" attrName="dictValue" laySearch="true" />
                </div>
                <i class="layui-icon layui-icon-edit" id="univTypeEdit" fieldName="univType" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="univTypeOk"  fieldName="univType" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="univTypeClose" fieldName="univType" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label" style="width:125px;">是否一流学科</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="isFirstClassSpan">
                               ${baseUniv.isFirstClass==1?'是':'否'}
                        </span>
                <div id="isFirstClass" style="display: none">
                    <input type="radio" name="isFirstClass" value="1" ${baseUniv.isFirstClass==1?'checked':''} title="是">
                    <input type="radio" name="isFirstClass" value="0" ${baseUniv.isFirstClass==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="isFirstClassEdit" fieldName="isFirstClass" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="isFirstClassOk"  fieldName="isFirstClass" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="isFirstClassClose" fieldName="isFirstClass" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

    </div>

    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">可用标记</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="univStatusSpan">
                               ${baseUniv.univStatus==1?'是':'否'}
                        </span>
                <div id="univStatus" style="display: none">
                    <input type="radio" name="univStatus" value="1" ${baseUniv.univStatus==1?'checked':''} title="是">
                    <input type="radio" name="univStatus" value="0" ${baseUniv.univStatus==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="univStatusEdit" fieldName="univStatus" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="univStatusOk"  fieldName="univStatus" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="univStatusClose" fieldName="univStatus" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">综合评分</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="combinedScoreSpan">
                               ${baseUniv.combinedScore}
                        </span>
                <input type="text" name="combinedScore" id="combinedScore" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="combinedScoreEdit" fieldName="combinedScore" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="combinedScoreOk"  fieldName="combinedScore" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="combinedScoreClose" fieldName="combinedScore" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label" style="width:140px;">是否有研究生院</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="hasMasterSpan">
                               ${baseUniv.hasMaster==1?'是':'否'}
                        </span>
                <div id="hasMaster" style="display: none">
                    <input type="radio" name="hasMaster" value="1" ${baseUniv.hasMaster==1?'checked':''} title="是">
                    <input type="radio" name="hasMaster" value="0" ${baseUniv.hasMaster==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="hasMasterEdit" fieldName="hasMaster" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="hasMasterOk"  fieldName="hasMaster" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="hasMasterClose" fieldName="hasMaster" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>






    </div>

    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">创办年份</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="establishYearSpan">
                               ${baseUniv.establishYear}
                        </span>
                <input type="text" name="establishYear" id="establishYear" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="establishYearEdit" fieldName="establishYear" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="establishYearOk"  fieldName="establishYear" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="establishYearClose" fieldName="establishYear" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">全国排名</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="rankSpan">
                               ${baseUniv.rank}
                        </span>
                <input type="text" name="rank" id="rank" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="rankEdit" fieldName="rank" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="rankOk"  fieldName="rank" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="rankClose" fieldName="rank" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label" style="width:125px;">是否独立院校</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="isIndependentSpan">
                               ${baseUniv.isIndependent==1?'是':'否'}
                        </span>
                <div id="isIndependent" style="display: none">
                    <input type="radio" name="isIndependent" value="1" ${baseUniv.isIndependent==1?'checked':''} title="是">
                    <input type="radio" name="isIndependent" value="0" ${baseUniv.isIndependent==0?'checked':''} title="否">
                </div>

                <i class="layui-icon layui-icon-edit" id="isIndependentEdit" fieldName="isIndependent" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="isIndependentOk"  fieldName="isIndependent" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="isIndependentClose" fieldName="isIndependent" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>


    </div>



    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">女生比例</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="girlProportionSpan">
                               ${baseUniv.girlProportion}
                        </span>
                <input type="text" name="girlProportion" id="girlProportion" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="girlProportionEdit" fieldName="girlProportion" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="girlProportionOk"  fieldName="girlProportion" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="girlProportionClose" fieldName="girlProportion" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>




        <div class="layui-inline">
            <label class="layui-form-label">生活满意度</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="liveSatisfactionSpan">
                               ${baseUniv.liveSatisfaction}
                        </span>
                <input type="text" name="liveSatisfaction" id="liveSatisfaction" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="liveSatisfactionEdit" fieldName="liveSatisfaction" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="liveSatisfactionOk"  fieldName="liveSatisfaction" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="liveSatisfactionClose" fieldName="liveSatisfaction" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label" style="width:160px;">生活满意度投票人数</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="liveVoteSpan">
                               ${baseUniv.liveVote}
                        </span>
                <input type="text" name="liveVote" id="liveVote" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="liveVoteEdit" fieldName="liveVote" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="liveVoteOk"  fieldName="liveVote" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="liveVoteClose" fieldName="liveVote" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>
    </div>


    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">是否女生多</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="isGirlMoreSpan">
                               ${baseUniv.isGirlMore==1?'是':'否'}
                        </span>
                <div style="display: none" id="isGirlMore">
                    <input type="radio" name="isGirlMore" value="1" ${baseUniv.isGirlMore==1?'checked':''} title="是">
                    <input type="radio" name="isGirlMore" value="0" ${baseUniv.isGirlMore==0?'checked':''} title="否">
                </div>


                <i class="layui-icon layui-icon-edit" id="isGirlMoreEdit" fieldName="isGirlMore" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="isGirlMoreOk"  fieldName="isGirlMore" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="isGirlMoreClose" fieldName="isGirlMore" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">环境满意度</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="envSatisfactionSpan">
                               ${baseUniv.envSatisfaction}
                        </span>
                <input type="text" name="envSatisfaction" id="envSatisfaction" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="envSatisfactionEdit" fieldName="envSatisfaction" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="envSatisfactionOk"  fieldName="envSatisfaction" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="envSatisfactionClose" fieldName="envSatisfaction" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width:160px;">环境满意度投票人数</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="envVoteSpan">
                               ${baseUniv.envVote}
                        </span>
                <input type="text" name="envVote" id="envVote" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="envVoteEdit" fieldName="envVote" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="envVoteOk"  fieldName="envVote" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="envVoteClose" fieldName="envVote" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

    </div>

    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">读研比例</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="masterProportionSpan">
                               ${baseUniv.masterProportion}
                        </span>
                <input type="text" name="masterProportion" id="masterProportion" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="masterProportionEdit" fieldName="masterProportion" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="masterProportionOk"  fieldName="masterProportion" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="masterProportionClose" fieldName="masterProportion" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">综合满意度</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="combinedSatisfactionSpan">
                               ${baseUniv.combinedSatisfaction}
                        </span>
                <input type="text" name="combinedSatisfaction" id="combinedSatisfaction" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="combinedSatisfactionEdit" fieldName="combinedSatisfaction" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="combinedSatisfactionOk"  fieldName="combinedSatisfaction" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="combinedSatisfactionClose" fieldName="combinedSatisfaction" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="width:160px;">综合满意度投票人数</label>
            <div class="layui-input-inline">
                        <span style="line-height:38px;margin-left:8px" id="combinedVoteSpan">
                               ${baseUniv.combinedVote}
                        </span>
                <input type="text" name="combinedVote" id="combinedVote" autocomplete="off" maxlength="50" class="layui-input" >
                <i class="layui-icon layui-icon-edit" id="combinedVoteEdit" fieldName="combinedVote" style="font-size: 12px; color: #00CD66;"></i>
                <i class="layui-icon layui-icon-ok layui-hide" id="combinedVoteOk"  fieldName="combinedVote" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="combinedVoteClose" fieldName="combinedVote" style="font-size: 12px; color: #FF3030;"></i>
            </div>
        </div>
    </div>

    <div class="layui-form-item">


        <div class="layui-inline">
            <label class="layui-form-label">校园介绍</label>

            <span style="line-height:38px;margin-left:8px" id="univDescSpan">
                       ${baseUniv.univDesc}
            </span>
            <div class="layui-input-block" style="width:712px;display: none" id="univDescDiv">
                <script id="univDesc" type="text/plain" placeholder="请输入" ></script>
            </div>
            <i class="layui-icon layui-icon-edit" id="univDescEdit" fieldName="univDesc" style="font-size: 12px; color: #00CD66;"></i>
            <div style="position:absolute;top: 0; left: 835px;width: 50px; height: 20px;">
                <i class="layui-icon layui-icon-ok layui-hide" id="univDescOk"  fieldName="univDesc" style="font-size: 12px; color: #00EE76;"></i>
                <i class="layui-icon layui-icon-close-fill layui-hide" id="univDescClose" fieldName="univDesc" style="font-size: 12px; color: #FF3030;"></i>
            </div>


        </div>
    </div>

</form>
<!--#} -->
<script type="text/javascript"  src="${ctxPath}/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript"  src="${ctxPath}/plugins/ueditor/ueditor.all.js"></script>
<script>

    var ue = UE.getEditor('univDesc',{
        toolbars: [["undo", "redo",
            "|", "fontsize", "forecolor", "bold", "italic", "underline",
            "|", "justifyleft", "justifycenter", "justifyright", "justifyjustify", "lineheight",
            "|", "directionalityltr", "directionalityrtl", "indent",
            "|", "backcolor", "autotypeset", "spechars", "source",
            "|", "searchreplace", "|", "fullscreen","mobile"]],
        serverUrl: "${ctxPath}/content/ebookChapter/config",
        autoHeightEnabled: false,
        elementPathEnabled : false,　　//是否启用元素路径，默认是true显示
        wordCount:false,          //是否开启字数统计
        initialFrameHeight:300
    });
    Common.initImage();
    layui.extend({
        cascadeSelect: '../../../plugins/layui_extends/cascadeSelect'  //  {/}的意思即代表采用自有路径，即不跟随 base 路径
    }).use(['index', 'form', 'laydate','upload','cascadeSelect'], function () {
        var $ = layui.$
            , element = layui.element
            , layer = layui.layer
            , cascadeSelect = layui.cascadeSelect
            , form = layui.form
            , upload = layui.upload;
        form.render(null, 'component-form-group');
        cascadeSelect.init('ProvinceId', false);
        $("input").css({"display":"none"});
        $("textarea").css({"display":"none"});
        var img ;
        $("i").click(function(){
            var idName = $(this).attr('id');
            if(idName.indexOf("Edit") != -1 ){
                idName = idName.substring(0,idName.length-4);
                $("#"+idName).val($("#"+idName+"Span").text().trim());
                if(idName=='provId'){
                    $("#citySpan").hide();
                    $("#provIdDiv").css({"display":""})
                    $("#cityDiv").css({"display":""})
                }
                if(idName=='univType'){
                    $("#univTypeDiv").css({"display":"inline"})
                }
                if(idName=='univDesc'){
                    $("#univDescDiv").css({"display":""});
                    var con = $("#univDescSpan").html();
                    // ue.setContent(con);
                    ue.execCommand('insertHtml', con);
                }
                if(idName=='logo'||idName=='backGround'){
                   img = $("#"+idName+"Img")[0].src;
                }
                updateClass(idName,false);

            }else if(idName.indexOf("Ok") != -1){
                idName = idName.substring(0,idName.length-2);
                var value = $("#"+idName).val();
                //radio 判断
                if(idName!='establishYear'&&(idName.indexOf("is")!=-1||idName=='univStatus'||idName=='hasMaster')){
                    value = $("input[name="+idName+"]:checked").val();
                }
                if(idName=='univDesc'){
                    value = ue.getContent();
                }
                if(value){
                    var map= new Map();
                    if(idName=='provId'){
                        if(!$("#city").val()){
                            layer.tips('请选择', '#cityDiv');
                            return;
                        }
                        map.set("city",$("#city").val());
                    }
                    map.set(idName,value.trim());
                    map.set("univId",${baseUniv.univId});
                    var flag = updateSubimt(map);
                    updateClassByBack(idName,flag,value);

                }else {
                    if (idName == 'provId'||idName == 'univType') {
                        layer.tips('请选择', '#' + idName+"Div");
                    } else{
                        layer.tips('请输入内容', '#' + idName);
                    }
                    $("#"+idName).focus();
                    return;
                }
                updateClass(idName,true);
            }else if(idName.indexOf("Close") != -1){
                idName = idName.substring(0,idName.length-5);
                updateClass(idName,true);
                if(idName=='provId'){
                    $("#citySpan").show();
                    $("#cityDiv").css({"display":"none"})
                    $("#provIdDiv").css({"display":"none"})
                }
                if(idName =='univType' ){
                    $("#univTypeDiv").css({"display":"none"})
                }
                if(idName=='univDesc'){
                    $("#univDescDiv").css({"display":"none"})
                }
            }
        });
        function updateClass(idName,flag) {
            $("#"+idName+"Edit").toggleClass("layui-hide",!flag)
            $("#"+idName+"Ok").toggleClass("layui-hide",flag);
            $("#"+idName+"Close").toggleClass("layui-hide",flag);
            if(idName=='logo'||idName=='backGround'){
                $("#"+idName+"Btn").toggleClass("layui-hide",flag);
                Common.uploadFile(upload,idName+"Btn",uploadBack);
            }
            if(flag){
                $("#"+idName+"Span").show();
                $("#"+idName).css({"display":"none"});
            }else{
                $("#"+idName+"Span").hide();
                $("#"+idName).css({"display":""});
            }
        }

        function updateClassByBack(idName,flag,value){
            if(flag.code==0){
                $("#"+idName+"Span").html(value);
                if(idName=='provId'){
                    var provId = $('#provId option:selected').text();
                    var city = $('#city option:selected').text();
                    $("#citySpan").show();
                    $("#provIdDiv").css({"display":"none"})
                    $("#cityDiv").css({"display":"none"})
                    $("#citySpan").html(city);
                    $("#"+idName+"Span").html(provId);
                }else if(idName =='univType' ){
                    var univType = $('#univType option:selected').text();
                    $("#univTypeDiv").css({"display":"none"})
                    $("#"+idName+"Span").html(univType);
                }else if(idName!='establishYear'&&(idName.indexOf("is")!=-1||idName=='univStatus'||idName=='hasMaster')){
                    $("#"+idName+"Span").html(value==1?'是':'否');
                }else if(idName=='univDesc'){
                    $("#univDescDiv").css({"display":"none"})
                }
                Common.success("操作成功");
            }else if(flag.code==701){

            }else{
                if(idName=='logo'||idName=='backGround'){
                    $('#'+idName+'Img').attr('src', img);
                    $('#'+idName).val("");
                }
                Common.info("操作失败");
            }
        }

        function updateSubimt(data) {
            var data ;
            $.ajax({
                type: "POST",
                url: "${ctxPath}/base/baseUniv/update.json",
                data: JSON.stringify(_strMapToObj(data)),
                dataType: "JSON" ,
                async:false,
                contentType: "application/json; charset=utf-8",
                success: function (message) {
                    data = message;
                   if(message.code == 701){
                        Common.openConfirm("登录超时，点击确定返回登录界面！",function(){
                            window.top.location.href = "${ctxPath}";
                        });
                    }
                },
                error: function (message) {
                }
            });
            return data;
        }

        function  _strMapToObj(strMap){
            let obj= Object.create(null);
            for (let[k,v] of strMap) {
                obj[k] = v;
            }
            return obj;
        }

        function uploadBack(res) {
            if(res.code==0){
                var id = res.data.elem.replace('Btn','');
                $('#'+id+'Img').attr('src', res.data.url);
                $('#'+id).val(res.data.url);
            }
            //上传成功
        }

    });

</script>
